<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a="http://richfaces.org/a4j"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rg="http://www.ruijie.com.cn/faces/ui"
	template="/layout/contentLayout.xhtml">

	<ui:param name="param_pageTitle"
		value="#{questionExtendAction.question.questionName}的子项信息" />
	<ui:param name="param_navigationUrl"
		value="/luyuan/sale/layout/navigationSale.jsf" />

	<ui:define name="road">
		<span><h:outputLink value="">#{messages.luyuan_crm_sale_question}</h:outputLink></span>
	</ui:define>


	<ui:define name="content">
		<a:form>
			<rg:areaPanel>
				<rg:titlePanel headerTitle="子项信息" style="margin-top: 10px;"
					readonly="false">
					<ui:define name="headerActions">
						<h:commandLink
							onclick="UI.instance.showDialog({id:'addQuestionExtend', src:'/luyuan/sale/addQuestionExtend.jsf?uuid=#{questionExtendAction.question.id}'});"
							value="#{messages.luyuan_crm_add}" />
					</ui:define>

					<rg:table id="questionExtendTable"
						value="#{questionExtendAction.tableModel}" var="item">
						<rg:column property="item" title="子项" width="100" />
						<rg:column property="name" title="子项名称" width="100" />
						<rg:column property="itemType" title="类型" width="100" />
						<rg:column property="defaultValue" title="默认值" width="100" />
						<rg:column type="oper" title="#{messages.luyuan_crm_operator}">
							<ul class="links">
								<h:panelGroup
									rendered="#{questionExtendAction.hasOptions(item.id)}">
									<a
										href="#{ctx}/luyuan/sale/questionExtendField.jsf?uuid=#{item.id}"
										class="button larger">子选项</a>
								</h:panelGroup>

								<li><h:commandLink
										action="#{questionExtendAction.delQuestionExtend(item.id)}"
										value="#{messages.luyuan_crm_delete}" /></li>
							</ul>
						</rg:column>
					</rg:table>
				</rg:titlePanel>
			</rg:areaPanel>
		</a:form>
		<a:form>
			<a:jsFunction name="reRenderQuestionExtendTable"
				reRender="questionExtendTable" />
		</a:form>
	</ui:define>
</ui:composition>
